<template>
  <div style="z-index: 999">
    <el-dialog
      :visible.sync="videoShow"
      :title="toEditCode + '视频'"
      width="50%"
      center
    >
      <div class="dialog-content">
        <iframe
          id="show-iframe"
          frameborder="0"
          scrolling="yes"
          style="
            background-color: transparent;
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            bottom: 0;
          "
          :src="url"
        >
        </iframe>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    toEditCode: 0,
  },
  data() {
    return {
      videoShow: false,
      url: null,
    };
  },
  watch: {},
  mounted() {
    if (this.toEditCode) {
      this.url =
        "http://test.ltjxb.cn:2302/video/index.html?deviceId=" +
        this.toEditCode;
    }
  },
  methods: {
    init() {
      this.videoShow = true;
    },
  },
};
</script>

<style lang="scss" scoped>
.dialog-content {
  z-index: 999;
}
::v-deep .el-dialog__body {
  padding: 0;
}
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
</style>
